<template>
<div class="home-banner">
    <XtxCarousel auto-play :sliders="bannerList"></XtxCarousel>
</div>
</template>

<script setup>
import XtxCarousel from "@/components/library/xtx-carousel.vue"
import { ref, onMounted } from 'vue'
import { getBanner } from '@/api/home'

onMounted(() => {
    getBannerList()
})

const bannerList = ref([])
const getBannerList = async () => {
    const { result } = await getBanner()
    bannerList.value = result
}
</script>

<style scoped lang="less">
.home-banner {
  width: 1240px;
  height: 500px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 98;
}

// 覆盖样式
.xtx-carousel {
  :deep(.carousel-btn.prev)  {
    left: 270px;
  }
  :deep(.carousel-indicator) {
    padding-left: 250px;
  }
}
</style>